<?php
/**
 * Created by PhpStorm.
 * User: 10037
 * Date: 2022/5/28
 * Time: 19:30
 */

namespace app\admin\model;


use think\Model;

class City extends Model
{
    protected $pk="id";

    public function selectLikeAddress($text){
        return $this->where('cityname','like','%'.$text.'%')->limit(10)->select();
    }

    public function selectPid($pid){
        return $this->find($pid);
    }

    public function selectProvince(){
       return $this->where('pid','=',1)->field('count')->select();
    }

    public function incProvinCount($text){
        $this->where('cityname','like','%'.$text.'%')->inc('count')->update();
    }

}